package com.stylefeng.guns.modular.netcar.warpper;

import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper;
import com.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

/**
 * 车辆列表的包装
 * @author 张亚林
 * @date 2018年11月02 18:10:31
 */
public class DriverInfoWarpper extends BaseControllerWarpper {

    public DriverInfoWarpper(Object list) {
        super(list);
    }

    @Override
    public void warpTheMap(Map<String, Object> map) {
        String diDeptId=(String)map.get("diDeptId");//所属车队
        String diIsAlived= (String) map.get("diIsAlived");//启用状态
        String diJoinCar=(String)map.get("diJoinCar");//加盟状态
        String diSex=(String)map.get("diSex");//性别
        String diLicenseType=(String) map.get("diLicenseType");//驾照类型
        String diCheckResult=(String)map.get("diCheckResult");//审核状态
        if(StringUtils.isNotBlank(diDeptId))
            map.put("diDeptIdName", ConstantFactory.me().getOrgName(Integer.parseInt(diDeptId)));
        if(StringUtils.isNotBlank(diIsAlived))
            map.put("diIsAlivedName", ConstantFactory.me().getDictNameByCode("sys_state",diIsAlived));
        if(StringUtils.isNotBlank(diJoinCar))
            map.put("diJoinCarName",  ConstantFactory.me().getDictNameByCode("join-state",diJoinCar));
        if(StringUtils.isNotBlank(diSex))
            map.put("diSexName",  ConstantFactory.me().getDictNameByCode("sys_sex",diSex));
        if(StringUtils.isNotBlank(diLicenseType))
            map.put("diLicenseTypeName",  ConstantFactory.me().getDictNameByCode("license-Type",diLicenseType));
        if(StringUtils.isNotBlank(diCheckResult))
            map.put("diCheckResultName",  ConstantFactory.me().getDictNameByCode("audit-state",diCheckResult));
   
      }

}
